package com.ruoyi.system.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.system.pojo.vms.SkuClassEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import javax.validation.constraints.NotBlank;
import java.util.List;

/**
 * Description:
 *
 * @author JourWon
 * @date Created on 2025/5/13
 */
@Mapper
public interface SkuClassDao extends BaseMapper<SkuClassEntity> {
    int count(@Param("className") String className);

    List<SkuClassEntity> searchByPage(@Param("className") String className, @Param("offset") int offset, @Param("pageSize") Integer pageSize);

    SkuClassEntity selectByClassName(@NotBlank(message = "商品类型名称不能为空") @Param("className") String className);

    int updateSkuClass(@Param("classId") Integer classId, @NotBlank(message = "商品类型名称不能为空") @Param("className") String className);

    int countSkusByClassId(@Param("classId") Integer classId);

    int countChildrenByParentId(@Param("parentId") Integer parentId);
}
